#include <bits/stdc++.h>
// 2025/03/22
// tag: 
// Author: Forever
using namespace std;
using int64 = int64_t;

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    //freopen("test.txt", "w", stdout);
    int t;
    cin >> t;
    while (t--){
        int n, x, sum = 0;
        cin >> n >> x;
        for (int i = 0; i < n; i++){
            int tmp;
            cin >> tmp;
            sum += tmp;
        }
        if (sum == x * n)
            cout << "YES" << endl;
        else
            cout << "NO" << endl;
    }

    return 0;
}